<template>
	<view class="rh-wx-container">
		<template v-if="isWechat">
			<slot></slot>
		</template>
		<template v-else>
			<view class="weixin-warning-container flex-column">
				<u-icon name="weixin-circle-fill" size="160" color="#06d568"></u-icon>
				<text class="weixin-warning">请使用微信浏览器打开</text>
			</view>
		</template>
	</view>
</template>

<script>
	import {isWechat} from '@/script/wx-premission.js'
	export default {
		data() {
			return {
				isWechat: isWechat()
			}
		},
	}
</script>
<style lang="scss" scoped>
	@mixin fontStyle($color, $size, $weight: 500) {
		color: $color;
		font-size: $size;
		font-weight: $weight;
	}
	.weixin-warning-container{
		padding-top: 30%;
		align-items: center;
		.weixin-warning{
			@include fontStyle(#333, 34rpx);
			margin-top: 30rpx;
		}
	}
	.rh-wx-container{
		min-height: 100vh;
		background-color: #F4F8F9;
		padding: 0 20rpx 120rpx;
	}
</style>


